package com.lgh.springframework.beans.factory.support;

import com.lgh.springframework.beans.BeansException;
import com.lgh.springframework.core.io.Resource;
import com.lgh.springframework.core.io.ResourceLoader;

/**
 * ******************************************************
 *
 * @author liugh9
 * @version 1.0
 * @classname BeanDefinitionReader
 * @description
 * @date 2023/02/25 0:15
 * <p>
 * ******************************************************
 */
public interface BeanDefinitionReader {

    /**
     * 获取注册器
     * @return
     */
    BeanDefinitionRegistry getRegistry();

    /**
     * 获取资源加载器
     * @return
     */
    ResourceLoader getResourceLoad();

    /**
     * 加载类定义
     * @param resource
     * @throws BeansException
     */
    void loadBeanDefinitions(Resource resource) throws BeansException ;

    /**
     * 批量加载bean定义
     * @param resources
     * @throw BeansException
     */
    void loadBeanDefinitions(Resource... resources) throws BeansException ;

    /**
     * 通过location加载bean定义
     * @param location
     * @throws BeansException
     */
    void loadBeanDefinitions(String location) throws BeansException;

    void loadBeanDefinitions(String... locations) throws BeansException;
}
